package cn.edu.scau.cmi.zhuangxipan.adapter;

import java.util.Collections;
import java.util.List;
import java.util.*;

public class AdapterOfObject implements Target{
	SortUtil sortUtil=new SortUtil();
	public void sortInt(List<Integer> intList) {
		sortUtil.sortInt(intList);
	}
	public void sortStudentList(List<Student> studentList) {
		List<Integer> intList =new ArrayList<Integer>();
		for(Student student: studentList) {
			intList.add(student.getId());
		}
		sortInt(intList);
		for(int i=0;i<studentList.size();i++) {
			for(int j=i+1;j<studentList.size();j++) {
				if(intList.get(i)==studentList.get(j).getId()) {
					Collections.swap(studentList, i, j);
				}
			}
		}
	}

}
